package cn.iocoder.yudao.module.fm.dal.mysql.tunnel;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.fm.dal.dataobject.tunnel.TunnelDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.fm.controller.admin.tunnel.vo.*;

/**
 * 隧道 Mapper
 *
 * @author 档案
 */
@Mapper
public interface TunnelMapper extends BaseMapperX<TunnelDO> {

    default PageResult<TunnelDO> selectPage(TunnelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TunnelDO>()
                .likeIfPresent(TunnelDO::getNo, reqVO.getNo())
                .likeIfPresent(TunnelDO::getMaterial, reqVO.getMaterial())
                .likeIfPresent(TunnelDO::getSurroundingRockLithologyAndDepthOfBurial, reqVO.getSurroundingRockLithologyAndDepthOfBurial())
                .likeIfPresent(TunnelDO::getLength, reqVO.getLength())
                .likeIfPresent(TunnelDO::getThicknessOfLining, reqVO.getThicknessOfLining())
                .betweenIfPresent(TunnelDO::getSecondLiningPouringTime, reqVO.getSecondLiningPouringTime())
                .likeIfPresent(TunnelDO::getFeatures, reqVO.getFeatures())
                .likeIfPresent(TunnelDO::getDiseaseAndDisease, reqVO.getDiseaseAndDisease())
                .likeIfPresent(TunnelDO::getLeaderOfTheStandTeam, reqVO.getLeaderOfTheStandTeam())
                .likeIfPresent(TunnelDO::getTeamLeaderOfConcreteClass, reqVO.getTeamLeaderOfConcreteClass())
                .likeIfPresent(TunnelDO::getGroupLeaderOfGroutingClassWithMold, reqVO.getGroupLeaderOfGroutingClassWithMold())
                .likeIfPresent(TunnelDO::getWetSprayManipulator, reqVO.getWetSprayManipulator())
                .likeIfPresent(TunnelDO::getLeaderOfDrainageTeam, reqVO.getLeaderOfDrainageTeam())
                .likeIfPresent(TunnelDO::getTechnician, reqVO.getTechnician())
                .likeIfPresent(TunnelDO::getQualityInspector, reqVO.getQualityInspector())
                .likeIfPresent(TunnelDO::getSurveyor, reqVO.getSurveyor())
                .likeIfPresent(TunnelDO::getEngineerOfSupervision, reqVO.getEngineerOfSupervision())
                .betweenIfPresent(TunnelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TunnelDO::getId));
    }

    default List<TunnelDO> selectList(TunnelExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<TunnelDO>()
                .likeIfPresent(TunnelDO::getNo, reqVO.getNo())
                .likeIfPresent(TunnelDO::getMaterial, reqVO.getMaterial())
                .likeIfPresent(TunnelDO::getSurroundingRockLithologyAndDepthOfBurial, reqVO.getSurroundingRockLithologyAndDepthOfBurial())
                .likeIfPresent(TunnelDO::getLength, reqVO.getLength())
                .likeIfPresent(TunnelDO::getThicknessOfLining, reqVO.getThicknessOfLining())
                .betweenIfPresent(TunnelDO::getSecondLiningPouringTime, reqVO.getSecondLiningPouringTime())
                .likeIfPresent(TunnelDO::getFeatures, reqVO.getFeatures())
                .likeIfPresent(TunnelDO::getDiseaseAndDisease, reqVO.getDiseaseAndDisease())
                .likeIfPresent(TunnelDO::getLeaderOfTheStandTeam, reqVO.getLeaderOfTheStandTeam())
                .likeIfPresent(TunnelDO::getTeamLeaderOfConcreteClass, reqVO.getTeamLeaderOfConcreteClass())
                .likeIfPresent(TunnelDO::getGroupLeaderOfGroutingClassWithMold, reqVO.getGroupLeaderOfGroutingClassWithMold())
                .likeIfPresent(TunnelDO::getWetSprayManipulator, reqVO.getWetSprayManipulator())
                .likeIfPresent(TunnelDO::getLeaderOfDrainageTeam, reqVO.getLeaderOfDrainageTeam())
                .likeIfPresent(TunnelDO::getTechnician, reqVO.getTechnician())
                .likeIfPresent(TunnelDO::getQualityInspector, reqVO.getQualityInspector())
                .likeIfPresent(TunnelDO::getSurveyor, reqVO.getSurveyor())
                .likeIfPresent(TunnelDO::getEngineerOfSupervision, reqVO.getEngineerOfSupervision())
                .betweenIfPresent(TunnelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TunnelDO::getId));
    }

}
